//----------------------------------------------------------------------------
/*
$lmYear,$lmMonth,$lmDay:are the names of labels
 $dotedBorder==1 if you want to get dotted border 
 OutPut of callling this method is simple calender 
 an example of calling this function 
 simpleCalender( lmYear, lmMonth, lmDay,2000,2030,2002,11,5)
 or 
  simpleCalender( lmYear, lmMonth, lmDay)
 */
function simpleCalender($lmYear,$lmMonth,$lmDay,$startY,$endY,$selectedY=0,$selectedM=0,$selectedD=0,$dotedBorder=0)
{//1
   print 
    '<table width="150" ';
	if ($dotedBorder==1)
	{//2
	  print 'border="0" style="border-style:dotted">';
	}//2
	else 
	{//3
	  print 'border="1" >';
	}//3  
  print "  
	<tr>
    <td><select name='$lmYear' id='$lmYear'>";
	for ($i=$startY ;$i<$endY+1 ;$i++  )
	{//1
	   if ($selectedY<>0  and ($selectedY==$i))
	     {print "<option id='$i' value='$i' selected=selected'>$i</option>";}
	   else 
	   	  {print "<option id='$i' value='$i' >$i</option>";}
	}//1
print "
    </select>
    </td>
    <td><select name='$lmMonth' id='$lmMonth'>";

	for ($i=1 ;$i<13 ;$i++  )
	{//1
	 if ($selectedM<>0  and ($selectedM==$i))
	     {print "<option id='$i' value='$i' selected=selected'>$i</option>";}
	   else 
	   	  {print "<option id='$i' value='$i' >$i</option>";}
	}//1
print "	
    </select>
    </td>
    <td><select name='$lmDay' id='$lmDay'>";

	for ($i=1 ;$i<32 ;$i++  )
	{//1
 
	 if ($selectedD<>0  and ($selectedD ==$i))
	      {print "<option id='$i' value='$i' selected=selected'>$i</option>";}
	   else 
	   	  {print "<option id='$i' value='$i' >$i</option>";}
	}//1 
   print ' </select>
   </table>
   ';

}//1

//.....then in the processing page you have to use this function to save the output of the previous function as a date in database 
//----------------------------------------------------------------------
/* input parameters : 
$slMonth:numeric value of month .
$slDay : numeric value of day 
$slYear: numeric value of year 
 */
function generateDate($slMonth,$slDay,$slYear,$format='Y/m/d')
{//22 
 
 $date = date($format, mktime(0,0,0, $slMonth , $slDay  ,  $slYear )); 
 return $date;
}//22
